topology2: sdw-jack-generic: Make BE DAI and copiers honor SDW_JACK_C…#11036
Draft
rfvirgil wants to merge 1 commit into
Draft
topology2: sdw-jack-generic: Make BE DAI and copiers honor SDW_JACK_C…#11036rfvirgil wants to merge 1 commit into
rfvirgil wants to merge 1 commit into
Conversation
…APTURE_CH The BE DAI, alh-copier and host-copier for capture should honor the number of capture channels set by SDW_JACK_CAPTURE_CH. Before this change, the value of SDW_JACK_CAPTURE_CH only affected the min/max channels of the FE DAI but all the other objects in the pipeline were defaulting to 2-channel. Because of this, the codec DAI was always asked for a 2-channel capture, which won't work on codecs that only support 1 channel. And the host-copier output was 2-channel audio that could not be connected to the 1-channel DAI. Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
rfvirgil
force-pushed
the
tplg2-simple-jack-1ch-fix
branch
from
July 24, 2026 16:06
f968c19 to
91318ce
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the topology2 Intel SoundWire “sdw-jack-generic” platform configuration to correctly honor SDW_JACK_CAPTURE_CH for jack capture, addressing failures when the codec capture datapath only supports mono (e.g., CS42L42 DP0).
Changes:
- Set the capture BE DAI channel count from a hardcoded
2to$SDW_JACK_CAPTURE_CH. - Propagate
$SDW_JACK_CAPTURE_CHinto the host-gateway capture copier output audio formats. - Propagate
$SDW_JACK_CAPTURE_CHinto the capture ALH copier input audio format.
Comments suppressed due to low confidence (1)
tools/topology/topology2/platform/intel/sdw-jack-generic.conf:391
out_sample_typeis set to UNSIGNED_INTEGER butout_fmt_cfgis computed without incorporating the sample type, diverging from the defaultout_fmt_cfgexpression intools/topology/topology2/include/common/output_audio_format.conf:134. This can generate an incorrect format config for non-integer sample types.
out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]"
| out_bit_depth 32 | ||
| out_valid_bit_depth 32 | ||
| out_sample_type $SAMPLE_TYPE_FLOAT | ||
| out_fmt_cfg "$[($out_channels | ($out_valid_bit_depth * 256))]" |
Comment on lines
463
to
467
| in_rate $JACK_RATE | ||
| in_channels $SDW_JACK_CAPTURE_CH | ||
| in_bit_depth 32 | ||
| in_valid_bit_depth $SDW_LINK_VALID_BITS | ||
| in_sample_type $SAMPLE_TYPE_MSB_INTEGER |
bardliao
approved these changes
Jul 27, 2026
Contributor
Author
|
@bardliao For the last Copilot issue:
I tried setting the out_channels of the alh-copier but then I got corrupted audio, even if I also set out_fmt_cfg. |
rfvirgil
marked this pull request as draft
July 27, 2026 10:42
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CS42L42 capture DP only has 1 channel.
Jack capture was not working on CS42L42 even with SDW_JACK_CAPTURE_CH=1. This was because the simple-jack tplg did not apply SDW_JACK_CAPTURE_CH to the BE DAI or copiers. The result was that SOF/ASoC would attempt to open a 2-channel stream, which would then fail to prepare because DP0.ch1 does not exist.